<?php
/**
 * True Gallery EXIF Data Reader Plugin
 *
 * @version 1.0
 * @author Alexey N. Brin (userxp@joomlaportal.ru)
 * @filename exif.php
 * @package True Gallery
 * @copyright (C) 2008-2009 by joomlatune.ru
 * @license GNU/GPL: http://www.gnu.org/copyleft/gpl.html
 * 
 * If you fork this to create your own project, 
 * please make a reference to True Gallery someplace in your code 
 * and provide a link to http://www.joomlatune.ru
 *
 **/

defined('_VALID_MOS') or defined('_JEXEC') or die('Direct Access to this location is not allowed.');


class JTunePluginExif extends JTunePlugin 
{
	var $_name		= 'EXIF plugin';
	var $_version	= '1.0';
	var $_enabled	= true;
	var $_access	= '';
	
	function init() {
		if( JT_EXIF_AVAIL ) {
		// or if( function_exists( 'exif_read_data' ) ) {
			$this->_enabled = true;
		} else {
			$this->_enabled = false;
		}
	} //init
	
	function load( &$data ) {
		if( isset( $data ) && $this->_enabled ) {
			require_once( TG_JTUNE.'exif.php');
			$imagefile = TG_ORIGINALSPATH . $data->catid . DSX . $data->imgfilename;
			$exif =& JTuneExif::getInstance();
			$data->exif = $exif->getImageData( $imagefile );
			include_once JTuneLayout::getFile('exif');
		}
	} //load
	
} //JTunePluginExif
